//相机预览的着色器，不能直接使用 Sampler2D ，需要使用 samplerExternalOES 纹理采样器
//#extension GL_OES_EGL_image_external : require

//float 数据的精度
precision mediump float;

//顶点着色器传过来的 采样点的坐标
varying vec2 aCoord;

//采样器
//uniform samplerExternalOES vTexture;
uniform sampler2D vTexture1;
uniform sampler2D vTexture2;

uniform vec2 iResolution;
#define time iTime  =  2

void main(){
//    gl_FragColor = texture2D(vTexture2, aCoord);
//
//    vec2 uv = gl_FragCoord.xy / iResolution.xy;
//    vec4 texture1 = texture2D(vTexture1,uv);
//    vec4 texture2 = texture2D(vTexture2,uv);
//    float progress = abs(sin(iTime));
//    gl_FragColor = mix(texture1,texture2,step(uv.y,progress));

    vec4 color1 = texture2D(vTexture1, aCoord);
    vec4 color2 = texture2D(vTexture2, aCoord);
    gl_FragColor = mix(color1, color2, 0.8);

}